<?php
require_once "jssdk.php";
require_once "appid.php";

require_once "consql.php";

$sql = "update tra set pv=pv+1 where id = 7";
$result = mysql_query($sql);

$result =mysql_fetch_row(mysql_query("select * from tra where id=7"));
if($result==1){
	
}else{
	$sql ="insert into tra(id,pv,uv,zv,info) values(7,1,1,0,'SHYU统计')";
	mysql_query($sql);
}

$openid=isset($_GET['openid'])?$_GET['openid']:'';

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>感恩20年，我和vivo同在</title>
    <meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">
	<meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="black" name="apple-mobile-web-app-status-bar-style">
	<meta content="telephone=no" name="format-detection">
	<meta content="email=no" name="format-detection">
	<meta name="Description" content="感恩20年，我和vivo同在!我是第10000+位给vivo送祝福的人，你也来送祝福吧！"/>
	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
	<link rel="stylesheet" type="text/css" href="css/animate.min.css"/>
    <link rel="stylesheet" href="css/swiper.min.css">
	<link rel="stylesheet" type="text/css" href="css/reset.css"/>
	<link rel="stylesheet" type="text/css" href="css/function.css"/>
	<script>
		//统计代码
		var _hmt = _hmt || [];
		(function() {
		  var hm = document.createElement("script");
		  hm.src = "//hm.baidu.com/hm.js?fb3ecd5c30df5e0cc97bb044b00e4092";
		  var s = document.getElementsByTagName("script")[0]; 
		  s.parentNode.insertBefore(hm, s);
		})();
	</script>
	<script type="text/javascript">		
	//缩放比例
	if(/Android (\d+\.\d+)/.test(navigator.userAgent)){
		var version = parseFloat(RegExp.$1);
		if(version>2.3){
			var phoneScale = parseInt(window.screen.width)/640;
			document.write('<meta name="viewport" content="width=640, minimum-scale = '+ phoneScale +', maximum-scale = '+ phoneScale +', target-densitydpi=device-dpi">');
		}else{
			document.write('<meta name="viewport" content="width=640, target-densitydpi=device-dpi">');
		}
	}else{
		document.write('<meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">');
	}
	//微信去掉下方刷新栏
	if(RegExp("MicroMessenger").test(navigator.userAgent)){
		document.addEventListener('WeixinJSBridgeReady', function() {
		    WeixinJSBridge.call('hideToolbar');
		});
	}

	</script>
    <style>	
	.mask{width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: none;}
	
	</style>
</head>
<body style="height: 100%;">
	<audio src="font/bj.mp3" loop="loop" style="opacity: 0;" id="aud1"></audio>
	<audio src="font/fbz.mp3" style="opacity: 0;" id="aud2"></audio>

    <!-- Swiper 页面组group1 -->
    <div class="swiper-container group1">
        <div class="swiper-wrapper">
            <div class="swiper-slide g1p1 stop-swiping">
            	<div id="flipbook">
            		
            		
            		

            		<div class="f9">
            		<div class="flip9">
            			<img class="f9m1" src="imgs/6.png" onmousedown="return false;"/>
            			<div class="f9m2">
            				<img class="f9m2m1" src="imgs/5-1.png" onmousedown="return false;"/>
            				<img class="f9m2m2" src="imgs/5.png" onmousedown="return false;"/>
            			</div>
            			<img class="f9m3" src="imgs/7.png" onmousedown="return false;"/>
            			<img class="f9m4" src="imgs/4.png" />
            			<div class="f9m5">
            				<img src="imgs/8.png" onmousedown="return false;"/>
            				<span class="paiwei" onmousedown="return false;">10000</span>
            				<img src="imgs/9.png" onmousedown="return false;"/>
            				<br />
            				<img src="imgs/10.png" onmousedown="return false;"/>
            			</div>
            			<div class="mask"></div>
            		</div><img class="zj9" src="imgs/zj.png" onmousedown="return false;"/>
            		</div>
            		
            		
            		
            		
            		
            		
            		<div class="f8">
            		<div class="flip8">
            			<img class="f6m1" src="imgs/bg8.png" onmousedown="return false;"/>
            		</div><img class="zj8" src="imgs/zj.png" onmousedown="return false;"/>
            		</div>
            		
            		
            		
            		<div class="f7">
            		<div class="flip7">
            			<img class="f6m1" src="imgs/bg7.png" onmousedown="return false;"/>
            		</div><img class="zj7" src="imgs/zj.png" onmousedown="return false;"/>
            		</div>
            		
            		
            		<div class="f10">
            		<div class="flip10">
            			<img class="f10m1" src="imgs/bg10.png" onmousedown="return false;"/>
            		</div><img class="zj10" src="imgs/zj.png" onmousedown="return false;"/>
            		</div>
            		
            		
            		
            		<div class="f6">
            		<div class="flip6">
            			<img class="f6m1" src="imgs/bg6.png" onmousedown="return false;"/>
            		</div><img class="zj6" src="imgs/zj.png" onmousedown="return false;"/>
            		</div>
            		
            		
            		
            		<div class="f5">
            		<div class="flip5">
            			<img class="f5m1" src="imgs/bg5.png" onmousedown="return false;"/>
            		</div><img class="zj5" src="imgs/zj.png" onmousedown="return false;"/>
            		</div>
            		
            		
            		
            		<div class="f4">
            		<div class="flip4">
            			<img class="f4m1" src="imgs/bg4.png" onmousedown="return false;"/>
            		</div><img class="zj4" src="imgs/zj.png" onmousedown="return false;"/>
            		</div>
            		
            		
            		
            		<div class="f3">
            		<div class="flip3">
            			<img class="f3m1" src="imgs/bg3.png" onmousedown="return false;"/>
            		</div><img class="zj3" src="imgs/zj.png" onmousedown="return false;"/>
            		</div>
            		
            		
            		
            		<div class="f2">
            		<div class="flip2">
            			<img class="f2m1" src="imgs/bg2.png" onmousedown="return false;"/>
            		</div><img class="zj2" src="imgs/zj.png" onmousedown="return false;"/>
            		</div>
            		
            		
            		
            		<div class="f1">
            		<div class="flip1">
            			<img class="f1m1" src="imgs/bg1.png" onmousedown="return false;"/>
            			<img class="f1m2" src="imgs/ar.png" onmousedown="return false;"/>
            		</div><img class="zj1" src="imgs/zj.png" onmousedown="return false;"/>
            		</div>
            		
            		
            		
            	</div>
            </div>

        </div>
       
    </div>
    
    <!--loading页面组-->
	<div class="swiper-container loadgroup stop-swiping">
        <div class="swiper-wrapper">
            <div class="swiper-slide loading">
            	<div class="hjian">
            	<img src="imgs/1.png"/>
            	<img class="hj hja" src="imgs/2.jpg"/>
            	<img src="imgs/3.png"/></div>
            	<p class="dyz">正在拼命打印······</p>
            	<span id="lspan">0%</span>
            </div>
        </div>       
    </div>
	<!--loading页面组结束-->


    <script src="js/swiper3.min.js"></script>
    <script src="js/swianimate.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/Touch.js" type="text/javascript" charset="utf-8"></script>
	<!--<script src="js/turn.min.js" type="text/javascript" charset="utf-8"></script>-->
	<script src="js/reset.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/function.js" type="text/javascript" charset="utf-8"></script>
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script type="text/javascript">
		$(function(){
			$('.f9m4').on('click',function(){
				$('.mask').css({
					'display':'block'
				});
				$('.f9m2m1').addClass('f9m2m1a1');
				setTimeout(function(){
					$('.f9m2m1').addClass('f9m2m1a');
				},600)
				
				
				$.ajax({
		        	type:'POST',
		        	url:'zv.php',
		        	data:'zv=zfv&openid='+openid,     //name=John&location=Boston
		        	success:function(msg){
		        		<?php
		        			$sql="select * from openuser where openid='".$openid."'";
							$row= mysql_fetch_row(mysql_query($sql));
		        			if($row>=1){
								$sql="SELECT * FROM openuser where openid='".$openid."'";

								$result=mysql_query($sql);
							
								while($row=mysql_fetch_array($result)){
									$zf=$row['id'];
									$zf=$zf+10000;
								};
							}else{
								$sql="SELECT * FROM zfrs where id = 1";

								$result=mysql_query($sql);
							
								while($row=mysql_fetch_array($result)){
									$zf=$row['zf'];
								};																
							}																
		        		
						?>
		        		var zf='<?php echo $zf;?>';
						$('.paiwei').html(zf);
						$('.f9m5').addClass('f9m5a');
		        	}
		        })				
			});
			var openid='<?php echo $openid;?>';

		})
	</script>
	
	<script>  
	  wx.config({
	    debug: false,
	    appId: '<?php echo $signPackage["appId"];?>',
	    timestamp: <?php echo $signPackage["timestamp"];?>,
	    nonceStr: '<?php echo $signPackage["nonceStr"];?>',
	    signature: '<?php echo $signPackage["signature"];?>',
	    jsApiList: [
	      // 所有要调用的 API 都要加到这个列表中
	      'onMenuShareTimeline',
		  'onMenuShareAppMessage',
		  'scanQRCode',
		  'onMenuShareQQ',
		  'chooseImage'
	    ]
	  });
	  wx.error(function(res){});
	  
	  wx.ready(function () {
		var zf='<?php echo $zf;?>';
	    // 在这里调用 API
	    //pyv
	    wx.onMenuShareTimeline({
		    title: '感恩20年，我和vivo同在!我是第'+zf+'位给vivo送祝福的人，你也来送祝福吧！', // 分享标题
		    link: 'http://m.giant-king.com/testdoc/vivo-ble/vivo.php', // 分享链接
		    imgUrl: 'http://m.giant-king.com/vivo.jpg', // 分享图标
		    success: function () { 
		        $.ajax({
		        	type:'POST',
		        	url:'zv.php',
		        	data:'zv=pyv',     //name=John&location=Boston
		        	success:function(msg){

		        	}
		        })
		    },
		    cancel: function () { 

		    }
			});
			//hyv
			wx.onMenuShareAppMessage({
			    title: '感恩20年，我和vivo同在', // 分享标题
			    desc: '我是第'+zf+'位给vivo送祝福的人，你也来送祝福吧！',
			    link: 'http://m.giant-king.com/testdoc/vivo-ble/vivo.php',
			    imgUrl: 'http://m.giant-king.com/vivo.jpg',
			    type: '', 
			    dataUrl: '', 
			    success: function () { 

			        $.ajax({
			        	type:'POST',
			        	url:'zv.php',
			        	data:'zv=hyv',     //name=John&location=Boston
			        	success:function(msg){
//			        		alert(msg);
			        	}
			        })
			    },
			    cancel: function () { 
			        // 用户取消分享后执行的回调函数
//			        alert('不考虑让身边的人知道么！！！');
			    }
			});
			//qqv
			wx.onMenuShareQQ({
			    title: '感恩20年，我和vivo同在', // 分享标题
			    desc: '我是第'+zf+'位给vivo送祝福的人，你也来送祝福吧！', // 分享描述
			    link: 'http://m.giant-king.com/testdoc/vivo-ble/vivo.php', // 分享链接
			    imgUrl: 'http://m.giant-king.com/vivo.jpg', // 分享图标
			    success: function () { 
			       // 用户确认分享后执行的回调函数
			       $.ajax({
			        	type:'POST',
			        	url:'zv.php',
			        	data:'zv=qqv',     //name=John&location=Boston
			        	success:function(msg){
//			        		alert(msg);
			        	}
			        })	
			    },
			    cancel: function () { 
			       // 用户取消分享后执行的回调函数
//			       alert('不考虑让身边的人知道么！！！');
			    }
			});	
	  });
	
	</script>
</body>
</html>